\documentclass[a4paper,AutoFakeBold,oneside,12pt]{article}

%need xelatex
\usepackage[fntef]{ctex} % invole CJKfntef
\usepackage{ctex}

\usepackage{fontspec}%包含俄文

\setmainfont{CMU Serif}
%\setmainfont{LinLibertine}
%%%%%%%% 这两个宏包冲突, 只可保留其中一个
%\usepackage{amsfonts}
\usepackage{mathrsfs}
%%%%%%%%

%罗马数字
\newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}}

\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsmath}
\usepackage{amsthm}

\usepackage{tikz}
\usepackage[plain]{algorithm}
\usepackage{algpseudocode}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{bm}
\usepackage{physics}
\usepackage{calligra}
\usepackage{csquotes}
\usepackage{tensor}
\usepackage[thicklines]{cancel}
\usepackage{tcolorbox}
\usepackage{pstricks}
\usepackage{amssymb}
\usepackage{listings}

\usetikzlibrary{automata,positioning}

%
% Basic Document Settings
%

\topmargin=-0.45in
\evensidemargin=0in
\oddsidemargin=0in
\textwidth=6.5in
\textheight=9.0in
\headsep=0.25in

\linespread{1.1}

\pagestyle{fancy}
\lhead{\hmwkAuthorName}
\chead{\hmwkClass\ \hmwkClassInstructor\ \hmwkClassTime: \hmwkTitle}
\rhead{\firstxmark}
\lfoot{\lastxmark}
\cfoot{\thepage}

\renewcommand\headrulewidth{0.4pt}
\renewcommand\footrulewidth{0.4pt}

\setlength\parindent{0pt}

%
% Create Problem Sections
%

\newcommand{\enterProblemHeader}[1]{
	\nobreak\extramarks{}{习题 \arabic{#1} 接下页\ldots}\nobreak{}
	\nobreak\extramarks{习题 \arabic{#1} (continued)}{习题 \arabic{#1} 接下页\ldots}\nobreak{}
}

\newcommand{\exitProblemHeader}[1]{
	\nobreak\extramarks{习题 \arabic{#1} (continued)}{习题 \arabic{#1} 接下页\ldots}\nobreak{}
	\stepcounter{#1}
	\nobreak\extramarks{习题 \arabic{#1}}{}\nobreak{}
}

\setcounter{secnumdepth}{0}
\newcounter{partCounter}
\newcounter{homeworkProblemCounter}
\setcounter{homeworkProblemCounter}{1}
\nobreak\extramarks{Problem \arabic{homeworkProblemCounter}}{}\nobreak{}

\newenvironment{homeworkProblem}{
	\section{习题 \arabic{homeworkProblemCounter}}
	\setcounter{partCounter}{1}
	\enterProblemHeader{homeworkProblemCounter}
}{
	\exitProblemHeader{homeworkProblemCounter}
}

%
% Homework Details
%   - Title
%   - Due date
%   - Class
%   - Section/Time
%   - Instructor
%   - Author
%

\newcommand{\hmwkTitle}{作业\ \#2}
\newcommand{\hmwkDueDate}{9月14日, 2019}
\newcommand{\hmwkClass}{概率论与随机过程}
\newcommand{\hmwkClassTime}{}
\newcommand{\hmwkClassInstructor}{}
\newcommand{\hmwkAuthorName}{杨勇,2019110294}

%
% Title Page
%

\title{
	\vspace{2in}
	\textmd{\textbf{\hmwkClass:\ \hmwkTitle}}\\
	\normalsize\vspace{0.1in}\small{完成于 \hmwkDueDate}\\
	\vspace{0.1in}\large{\textit{\hmwkClassInstructor\ \hmwkClassTime}}
	\vspace{3in}
}

\author{\textbf{\hmwkAuthorName}}
\date{}

\renewcommand{\part}[1]{\textbf{\large Part \Alph{partCounter}}\stepcounter{partCounter}\\}

%
% Various Helper Commands
%

% Useful for algorithms
\newcommand{\alg}[1]{\textsc{\bfseries \footnotesize #1}}

% For derivatives
\newcommand{\deriv}[1]{\frac{\mathrm{d}}{\mathrm{d}x} (#1)}

% For partial derivatives
\newcommand{\pderiv}[2]{\frac{\partial}{\partial #1} (#2)}

% Integral dx
\newcommand{\dx}{\mathrm{d}x}

% Alias for the Solution section header
\newcommand{\solution}{\textbf{\large 解.}}

% Probability commands: Expectation, Variance, Covariance, Bias
\newcommand{\E}{\mathrm{E}}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\Cov}{\mathrm{Cov}}
\newcommand{\Bias}{\mathrm{Bias}}

\begin{document}
	
	\maketitle
	
	
	
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	\pagebreak
	\begin{homeworkProblem}
		P36-37(18)某人将$n$封写好的信随机装入$n$个相应地址的信封中, 问没有一封信装对地址的概率是多少?
	\end{homeworkProblem}
	
	
	\begin{homeworkProblem}
		P36-37(19)甲乙二人约定中午1~2点间在某地会面, 约定先到者等候10分钟即离去, 设甲乙二人各自随意在1~2点之间选一个时刻到达约会地点, 问"甲、乙两人能会面"这一事件的概率是多少?
	\end{homeworkProblem}

	\begin{homeworkProblem}
		P36-37(21)在$[0,1]$上任取两数, 求两数之和小于$\begin{lgathered}\frac{6}{5}\end{lgathered}$的概率.
	\end{homeworkProblem}
	
	
	
	\begin{homeworkProblem}
		P36-37(25)设$P(\overline{A}) = 0.3,P(B) = 0.4, P(A\overline{B}) = 0.5$, 求$P(A\cup\overline{B})$, $P(A\cup B)$, $P(\overline{A}\cup\overline{B})$.
	\end{homeworkProblem}
	
	\begin{homeworkProblem}
		古典: 抽签与顺序无关
	\end{homeworkProblem}
	
	\begin{homeworkProblem}
	    证明P20最后一个公式(一般加法公式)
	\end{homeworkProblem}
	
\end{document}
